{foreach from=$hoge name="mydata" item="datum" key="key"}
{if $smarty.foreach.mydata.first}
<table border="1" width="50%" cellpadding="8" cellspacing="0">
  <tr style="background-color:#000000;color:#ffffff;">
    <th>key</th>
    <th>value</th>
  </tr>
{/if}
  <tr style="background-color:{cycle values="#ffffff,#cccccc"};">
    <td>{$key}</td>
    <td>{$datum}</td>
  </tr>
{if $smarty.foreach.mydata.last}</table>{/if}
{/foreach}

{foreach from=$bar}
{foreachelse}
displayed by foreachelse
{/foreach}